//
//  BanJiCell.m
//  SanYiTeaching
//
//  Created by 李文强 on 2019/4/13.
//  Copyright © 2019 SanYi. All rights reserved.
//

#import "BanJiCell.h"

@implementation BanJiCell
- (instancetype)initWithFrame:(CGRect)frame{
    if ([super initWithFrame:frame]) {
        [self initSubView];
    }
    return self;
}
- (void)initSubView{
    self.backgroundColor = CONTENTBACKCOLOR;
    [self addSubview:self.titleLabel];
    [self addSubview:self.courseNameLabel];
    [self addSubview:self.mentorLabel];
    [self addSubview:self.dangQianJingDuLabel];
    [self addSubview:self.shangKeShiJianLabel];
    [self addSubview:self.nianJiLabel];
    [self addSubview:self.keMuLable];
    [self addSubview:self.zhaoShengRenShuLabel];
    [self addSubview:self.jiaoShiLabel];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@12);
        make.right.equalTo(@0).offset(-12);
        make.top.equalTo(@15);
        make.height.equalTo(@12);
    }];
    [_courseNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@12);
        make.right.equalTo(@0).offset(-12);
        make.top.equalTo(self.titleLabel.mas_bottom).offset(14);
        make.height.equalTo(@12);
    }];
    [_mentorLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@12);
        make.right.equalTo(@0).offset(-12);
        make.top.equalTo(self.courseNameLabel.mas_bottom).offset(11);
        make.height.equalTo(@12);
    }];
    [_dangQianJingDuLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@12);
        make.right.equalTo(@0).offset(-12);
        make.top.equalTo(self.mentorLabel.mas_bottom).offset(11);
        make.height.equalTo(@12);
    }];
    [_shangKeShiJianLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@12);
        make.right.equalTo(@0).offset(-12);
        make.top.equalTo(self.dangQianJingDuLabel.mas_bottom).offset(11);
        make.height.equalTo(@12);
    }];
    [_nianJiLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@12);
        make.right.equalTo(@0).offset(-12);
        make.top.equalTo(self.shangKeShiJianLabel.mas_bottom).offset(11);
        make.height.equalTo(@12);
    }];
    [_keMuLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@12);
        make.right.equalTo(@0).offset(-12);
        make.top.equalTo(self.nianJiLabel.mas_bottom).offset(11);
        make.height.equalTo(@12);
    }];
    [_zhaoShengRenShuLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@12);
        make.right.equalTo(@0).offset(-12);
        make.top.equalTo(self.keMuLable.mas_bottom).offset(11);
        make.height.equalTo(@12);
    }];
    [_jiaoShiLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@12);
        make.right.equalTo(@0).offset(-12);
        make.top.equalTo(self.zhaoShengRenShuLabel.mas_bottom).offset(11);
        make.height.equalTo(@12);
    }];
}
- (UILabel *)titleLabel{
    if (!_titleLabel) {
        UILabel *label = [[UILabel alloc] init];
        label.frame = CGRectMake(0,0,156.5,13);
        label.numberOfLines = 0;
        label.font = [UIFont systemFontOfSize:14];
        label.textColor = [UIColorChange colorwithHexString:@"#20B097"];
        label.text = @"单茹 18 新一 1-D 六A";
        _titleLabel = label;
    }
    return _titleLabel;
}
- (UILabel *)courseNameLabel{
    if (!_courseNameLabel) {
        UILabel *label = [[UILabel alloc] init];
        label.frame = CGRectMake(0,0,156.5,13);
        label.numberOfLines = 0;
        label.font = [UIFont systemFontOfSize:12];
        label.textColor = TITLECOLOR;
        label.text = @"课程名称：音标+新一1期 ";
        label.attributedText = [PublickFunctionObject getPriceAttribute:label.text and:SELECTEDCOLOR andChangeBenginString:@"：" andEndString:@" " andSize:12];
        _courseNameLabel = label;
    }
    return _courseNameLabel;
}
- (UILabel *)mentorLabel{
    if (!_mentorLabel) {
        UILabel *label = [[UILabel alloc] init];
        label.frame = CGRectMake(331.5,150,161,12.5);
        label.numberOfLines = 0;
        label.text = @"任课老师：候园/单茹，李梦迪";
        label.font = [UIFont systemFontOfSize:12];
        label.textColor = TITLECOLOR;
        _mentorLabel = label;
    }
    return _mentorLabel;
}
- (UILabel *)dangQianJingDuLabel{
    if (!_dangQianJingDuLabel) {
        UILabel *label = [[UILabel alloc] init];
        label.frame = CGRectMake(0,0,156.5,13);
        label.numberOfLines = 0;
        label.font = [UIFont systemFontOfSize:12];
        label.textColor = TITLECOLOR;
        label.text = @"当前进度：L25-26 ";
        label.attributedText = [PublickFunctionObject getPriceAttribute:label.text and:[UIColor redColor] andChangeBenginString:@"：" andEndString:@" " andSize:12];
        _dangQianJingDuLabel = label;
    }
    return _dangQianJingDuLabel;
}
- (UILabel *)shangKeShiJianLabel{
    if (!_shangKeShiJianLabel) {
        UILabel *label = [[UILabel alloc] init];
        label.frame = CGRectMake(0,0,156.5,13);
        label.numberOfLines = 0;
        label.font = [UIFont systemFontOfSize:12];
        label.textColor = TITLECOLOR;
        label.text = @"上课时间：周六07：07-09：08 ";
        label.attributedText = [PublickFunctionObject getPriceAttribute:label.text and:SELECTEDCOLOR andChangeBenginString:@"：" andEndString:@" " andSize:12];
        _shangKeShiJianLabel = label;
    }
    return _shangKeShiJianLabel;
}
- (UILabel *)nianJiLabel{
    if (!_nianJiLabel) {
        UILabel *label = [[UILabel alloc] init];
        label.frame = CGRectMake(0,0,156.5,13);
        label.numberOfLines = 0;
        label.font = [UIFont systemFontOfSize:12];
        label.textColor = TITLECOLOR;
        label.text = @"年纪：16 ";
        label.attributedText = [PublickFunctionObject getPriceAttribute:label.text and:SELECTEDCOLOR andChangeBenginString:@"：" andEndString:@" " andSize:12];
        _nianJiLabel = label;
    }
    return _nianJiLabel;
}
- (UILabel *)keMuLable{
    if (!_keMuLable) {
        UILabel *label = [[UILabel alloc] init];
        label.frame = CGRectMake(0,0,156.5,13);
        label.numberOfLines = 0;
        label.font = [UIFont systemFontOfSize:12];
        label.textColor = TITLECOLOR;
        label.text = @"科目：新概念一/每周一次";
        _keMuLable = label;
    }
    return _keMuLable;
}
- (UILabel *)zhaoShengRenShuLabel{
    if (!_zhaoShengRenShuLabel) {
        UILabel *label = [[UILabel alloc] init];
        label.frame = CGRectMake(0,0,156.5,13);
        label.numberOfLines = 0;
        label.font = [UIFont systemFontOfSize:12];
        label.textColor = TITLECOLOR;
        label.text = @"招生人数：34/34 ";
        label.attributedText = [PublickFunctionObject getPriceAttribute:label.text and:SELECTEDCOLOR andChangeBenginString:@"：" andEndString:@" " andSize:12];
        _zhaoShengRenShuLabel = label;
    }
    return _zhaoShengRenShuLabel;
}
- (UILabel *)jiaoShiLabel{
    if (!_jiaoShiLabel) {
        UILabel *label = [[UILabel alloc] init];
        label.frame = CGRectMake(0,0,156.5,13);
        label.numberOfLines = 0;
        label.font = [UIFont systemFontOfSize:12];
        label.textColor = TITLECOLOR;
        label.text = @"教室：郑东商业中心校区-3 ";
        label.attributedText = [PublickFunctionObject getPriceAttribute:label.text and:SELECTEDCOLOR andChangeBenginString:@"：" andEndString:@" " andSize:12];
        _jiaoShiLabel = label;
    }
    return _jiaoShiLabel;
}
- (void)setTitleName:(NSString *)string{
    _titleLabel.text = string;
}
- (void)setCourseNameName:(NSString *)string{
    _courseNameLabel.attributedText = [PublickFunctionObject getPriceAttribute:[NSString stringWithFormat:@"课程名称：%@",string] and:SELECTEDCOLOR andChangeBenginString:@"：" andEndString:@"" andSize:12];
}
- (void)setMentorName:(NSString *)string{
    _mentorLabel.text = [NSString stringWithFormat:@"任课老师：%@",string];
}
- (void)setDangQianJingDuName:(NSString *)string{
    _dangQianJingDuLabel.attributedText = [PublickFunctionObject getPriceAttribute:[NSString stringWithFormat:@"%@",string] and:[UIColor redColor] andChangeBenginString:@"：" andEndString:@"" andSize:12];
}
- (void)setShangKeShiJianName:(NSString *)string{
   _shangKeShiJianLabel.attributedText = [PublickFunctionObject getPriceAttribute:[NSString stringWithFormat:@"上课时间：%@",string] and:SELECTEDCOLOR andChangeBenginString:@"：" andEndString:@"" andSize:12];
}
- (void)setNianJiLabelName:(NSString *)string{
    _nianJiLabel.attributedText = [PublickFunctionObject getPriceAttribute:[NSString stringWithFormat:@"年级：%@",string] and:SELECTEDCOLOR andChangeBenginString:@"：" andEndString:@"" andSize:12];
}
- (void)setKeMuLableName:(NSString *)string{
    _keMuLable.text = [NSString stringWithFormat:@"科目：%@",string];
}
- (void)setZhaoShengRenShuLabelName:(NSString *)string{
    _zhaoShengRenShuLabel.attributedText = [PublickFunctionObject getPriceAttribute:[NSString stringWithFormat:@"招生人数：%@",string] and:SELECTEDCOLOR andChangeBenginString:@"：" andEndString:@"" andSize:12];
}
- (void)setJiaoShiLabelName:(NSString *)string{
    _jiaoShiLabel.attributedText = [PublickFunctionObject getPriceAttribute:[NSString stringWithFormat:@"教室：%@",string] and:SELECTEDCOLOR andChangeBenginString:@"：" andEndString:@"" andSize:12];
}
@end
